<template>
  <tfoot>
    <tr>
      <td>合计:</td>
      <td colspan="5"> {{ sum }} </td>
    </tr>
  </tfoot>
</template>

<script>
export default {
  props:['arr'],
  computed:{
    sum(){
      return this.arr.filter(it=>it.checked).reduce((sum,val)=>sum+=val.price*val.num,0)
    }
  }
}
</script>

<style scoped>

</style>
